package cn.com.b2office.dao;

import java.util.List;

import cn.com.b2office.domain.Member;
import cn.com.b2office.domain.MemberAddress;

public interface MemberDao {
	Member getMember(String memberId);

	void updateMember(Member member);

	/**
	 * 若不指定memberId,自动生成会员memberId
	 * 
	 * @param member
	 * @return
	 */
	String createMember(Member member);

	Member validateWebMember(String regName, String regPwd);

	Member validateTelMember(String memberno, String telPwd);

	MemberAddress getRegAddress(String memberId);

	List<MemberAddress> listAddresses(String memberId);

	MemberAddress getAddress(String addressId);

	void updateAddress(MemberAddress memberAddress);

	/**
	 * 若不指定addressId,自动生成会员addressId
	 * 
	 * @param member
	 * @return
	 */
	String createAddress(MemberAddress address);

	boolean ifRegNameExist(String regName);

	boolean ifRegEmailExist(String regEmail);

	/** 根据email 得到用户信息 */
	Member getMemberByEmail(String regEmail);

	Member getMemberByMemberno(String memberno);

	Member getMemberByNameAndEmail(String regName, String email);

	Member getMemberByMembernoAndEmail(String memberno, String email);
	/** 初始化会员密码 */
	void initializeMemberPwd(String memberId,String pwd);

}
